package com.example;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class JsonArray {
  public static void main(String[] args) {
    String jsonString= "{'cname': '高一三班', 'students':[{'no':'001','name':'张三'},{'no': '002', 'name': '李四'}]}";
    JSONObject jsonObject = JSON.parseObject(jsonString);
    String stus_str = jsonObject.getString("students");
    JSONArray stus_arr = JSON.parseArray(stus_str);
    for (int i = 0; i < stus_arr.size(); i++) {
      JSONObject stu_obj = stus_arr.getJSONObject(i);
      System.out.println(stu_obj.get("name"));

    }
  }
}
